package task3_15;

import java.util.Scanner;

/**
 * Create by IntelliJ IDEA
 *
 * @author: banana
 * @date-Time: 2018/4/13 10:24
 * @description:
 */
public class PrinterTest {

  public static void main(String[] args) {
    System.out.println("请输入：0 表示使用惠普、1表示Canon");
    Scanner scanner=new Scanner(System.in);
    int a=scanner.nextInt();
    PrinterFactory pf = new PrinterFactory();
    Printer printer=pf.getPrinter(a);
    printer.opem();
    printer.print();
    printer.close();
    /*if(a==0){
      HPrinter hPrinter =new HPrinter();
      hPrinter.close();
      hPrinter.opem();
      hPrinter.print();
    }else if(a==1){
      CPrinter cPrinter=new CPrinter();
      cPrinter.opem();
      cPrinter.close();
      cPrinter.print();
    }else{System.out.print("输入有误");}
  }*/

 }
}
